import { _decorator, Component, director, game, Node } from 'cc';
import { GameController } from '../GameController';
import { ResultEnum } from '../DataCenter/GlobalContext';
import GameInfo from '../DataCenter/GameInfo';
const { ccclass, property } = _decorator;

@ccclass('HomeView')
export class HomeView extends Component {
    @property(Node)
    startBtn: Node = null;
    @property(Node)
    quitBtn: Node = null;

    protected onLoad(): void {
        this.startBtn.on("click", this.onClickStartBtn, this);
        this.quitBtn.on("click", this.onClickQuitBtn, this);
    }

    Show(){

    }

    onClickStartBtn(){
        GameInfo.inst.gameStart();
        GameController.inst.showBattleView();
    }

    onClickQuitBtn(){
        director.end();
        game.end();
    }
}


